Skip to content

Survived Memory #1596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Survived Memory #1596

wants to merge 3 commits into from

Conversation

timcassell
Copy link
Collaborator

@timcassell timcassell commented Nov 18, 2020

In an attempt to address my question on #1579, I worked on this.

I added an optional includeSurvived flag on MemoryDiagnoserAttribute and --memorySurvived command line option to capture the survived memory from a benchmark run.

@dnfadmin
Copy link

dnfadmin commented Nov 18, 2020

CLA assistant check
All CLA requirements met.

@timcassell
Copy link
Collaborator Author

timcassell commented Dec 1, 2020

.NET Core 3.1 and 5.0 measurement issue: dotnet/runtime#45446

@timcassell
Copy link
Collaborator Author

timcassell commented Jul 9, 2022

Looks like measurement errors are fixed in .Net 7 as of dotnet/runtime#67160.

@timcassell timcassell force-pushed the survivedMemory branch 2 times, most recently from 51d25f1 to 73fffb5 Compare March 18, 2024 06:54
@timcassell timcassell marked this pull request as draft March 18, 2024 07:03
@timcassell timcassell force-pushed the survivedMemory branch 3 times, most recently from 7b8667d to 91027de Compare March 18, 2024 09:14
@timcassell timcassell marked this pull request as ready for review March 18, 2024 11:56
@JaggerJo
Copy link
Contributor

Looking forward to this feature 👀

@timcassell
Copy link
Collaborator Author

timcassell commented Jun 25, 2025

Unfortunately, survived memory is not so simple for the framework to measure automatically. The first invocation will include jit allocations and static memory, and the second invocation will miss pooled objects. When I used this in my own benchmarks (https://github.com/timcassell/CSharpAsynchronousBenchmarks), I took care to measure only pooled objects by adjusting the benchmarks in a complicated way. I don't think it's good for users to have to do that to get useful measurements. I think this will be better served by #784, so users can capture the survived memory that matters to them.

@timcassell timcassell closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants